package com.kingviker.example.nio;

import java.nio.IntBuffer;
import java.security.SecureRandom;

public class NioTest1 {
    public static void main(String[] args) {
        IntBuffer intBuffer = IntBuffer.allocate(10);
        SecureRandom random = new SecureRandom();
        for(int i=0;i<intBuffer.capacity();i++){
            intBuffer.put(random.nextInt(20));
        }
        intBuffer.flip();
       while(intBuffer.hasRemaining()){
           System.out.println(intBuffer.get());
       }
    }
}
